<?php

namespace App\Http\Controllers\home;

use App\Venue;
use App\Price;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class PriceController extends Controller
{
    // 价格维护
    public function edit($id){
        $venue = Venue::find($id);
        $prices = Price::where("venue_id",$id)->get();
        return view("price/edit",compact("prices","venue"));

    }

    // 更新价格
    public function update(Request $request){

        $price = Price::find($request->id);
        $price->price = $request->price;
        $price->save();

        return response()->json(["msg"=>"更新成功","code"=>200]);

    }
}
